<template>
  <div class="demo-date-picker">
    <div class="block">
      <span class="demonstration">房间预定</span>
      <el-date-picker
        v-model="date"
        type="daterange"
        range-separator="To"
        start-placeholder="入住日期"
        end-placeholder="退房日期"
        size="large"
        format="YYYY/MM/DD"
        value-format="x"
        @calendar-change="change"
      />
      <div>
        成人 13 岁及以上<el-input-number
          v-model="num"
          :min="1"
          :max="10"
          @change="handleChange"
        />
      </div>
      <div>
        儿童 2 - 12 岁
        <el-input-number
          v-model="num"
          :min="1"
          :max="10"
          @change="handleChange"
        />
      </div>
      <div>
        婴幼儿 2 岁以下
        <el-input-number
          v-model="num"
          :min="1"
          :max="10"
          @change="handleChange"
        />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";

const date = ref("");
const change = (data) => {
  console.log(data);
};
</script>

<style scoped>
.demo-date-picker {
  display: flex;
  width: 100%;
  padding: 0;
  flex-wrap: wrap;
}

.demo-date-picker .block {
  padding: 20px 0;
  text-align: center;
  border-right: solid 1px var(--el-border-color);
  flex: 1;
}

.demo-date-picker .block:last-child {
  border-right: none;
}

.demo-date-picker .demonstration {
  display: block;
  color: var(--el-text-color-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}
</style>
